/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * OpcionesUsuarios.java
 *
 * Created on 01/12/2011, 01:44:05 PM
 */
package GUI.AdministracionUsuarios;

import GUI.Principal;

/**
 *
 * @author CarLita
 */
public class MenuOpciones extends javax.swing.JPanel {
    Principal ventanaPrincipal;
    
    /** Creates new form OpcionesUsuarios */
    public MenuOpciones(Principal ventanaPrincipal) {
        initComponents();
        this.ventanaPrincipal = ventanaPrincipal;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnPerfiles = new javax.swing.JButton();
        lbl1 = new javax.swing.JLabel();
        lbl2 = new javax.swing.JLabel();
        btnUsuarios = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();

        btnPerfiles.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        btnPerfiles.setText("Perfiles");
        btnPerfiles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPerfilesActionPerformed(evt);
            }
        });

        lbl1.setText("<html> Búsqueda, creación, modificación y eliminación de usuarios del sistema, con asociación a perfiles.");

        lbl2.setText("<html> Búsqueda, creación, modificación y eliminación de perfiles. Permite definir el conjunto de funcionalidades disponibles para un usuario.");

        btnUsuarios.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        btnUsuarios.setText("Usuarios");
        btnUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUsuariosActionPerformed(evt);
            }
        });

        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(49, 49, 49)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(btnPerfiles, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(33, 33, 33)
                                .addComponent(lbl2, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(btnUsuarios, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(33, 33, 33)
                                .addComponent(lbl1, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(534, 534, 534)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(49, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(74, 74, 74)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbl1, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnUsuarios, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbl2, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPerfiles, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 134, Short.MAX_VALUE)
                .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

private void btnPerfilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPerfilesActionPerformed
    mostrarPerfiles();
}//GEN-LAST:event_btnPerfilesActionPerformed

private void btnUsuariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUsuariosActionPerformed
    mostrarUsuarios();
}//GEN-LAST:event_btnUsuariosActionPerformed

private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
    mostrarInicio();
}//GEN-LAST:event_btnCancelarActionPerformed

void mostrarPerfiles(){    
        ventanaPrincipal.panelUsuarios.menuOpciones.setVisible(false);
        ventanaPrincipal.panelUsuarios.add(ventanaPrincipal.panelUsuarios.mantPerfiles);
        ventanaPrincipal.panelUsuarios.mantPerfiles.setVisible(true);
}

void mostrarUsuarios(){
    this.setVisible(false);
        ventanaPrincipal.panelUsuarios.creacionUsuarios.llenarComboPerfiles();
        ventanaPrincipal.panelUsuarios.menuOpciones.setVisible(false);
        ventanaPrincipal.panelUsuarios.add(ventanaPrincipal.panelUsuarios.mantUsuarios);
        ventanaPrincipal.panelUsuarios.mantUsuarios.setVisible(true);
}

void mostrarInicio(){
    ventanaPrincipal.panelContenedor.removeAll();
    ventanaPrincipal.panelContenedor.repaint();
    ventanaPrincipal.mostrarInicio();
}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnPerfiles;
    private javax.swing.JButton btnUsuarios;
    private javax.swing.JLabel lbl1;
    private javax.swing.JLabel lbl2;
    // End of variables declaration//GEN-END:variables
}
